package com.qianli.user.ro;


import com.fqgj.exception.enums.MsgCodeEnum;

/**
 * name:
 * auth:ting.li@yuntu-inc.com
 * date:2017/11/711:31
 * version: v1.0.0
 **/
public enum UserStateCode implements MsgCodeEnum {
    SUCCESS(Integer.valueOf(0), "success"),
    INTERNAL_SERVER_ERROR(Integer.valueOf(500), "Internal server error"),
    REPEAT_SUBMIT(-112, "Repeat submission"),
    PARAMETER_LACK(-1101, "Parameter deletion"),
    ILLEGAL_PARAMS(-1102, "Parameter error"),
    USER_NOT_EXITS(-1103, "User does not exist"),
    USER_REGISTER_ALREADY(-1104, "Users have registered"),
    USER_FACE_RECOGNITION_NOT_EXISTS(-1105, "User face recognition does not exist"),
    USER_FACE_RECOGNITION_TYPE_NOT_MATCH(-1106, "User face recognition type mismatch"), //用户人脸识别类型不匹配
    USER_FACE_RECOGNITION_STATUS_NOT_MATCH(-1107, "User face recognition status mismatch"), //用户人脸识别状态不匹配
    USER_FROZEN_NEED_APPOINT_CATEGORYCODE(-1108, "Product category is required"), //借款被拒和额度评估被拒冷冻需要指定产品类目
    USER_HAS_APPOINT_CATEGORY_QUOTA(-1109, "Users have specified category limits"), //用户已有指定类目额度
    FORBID_MULTI_ADD_TAGS_FOR_USERS(-1110, "No labels are allowed for multiple users"), // 不允许给多个用户添加标签
    USER_AUTH_ZM_PRESUBMIT_NOT_EXISTS(-1111, "ZhiMa certification is not submitted successfully"), //芝麻认证预提交未成功
    USER_AUTH_ZM_ALREADY_AUTHORIZED(-1112, "User ZhiMa has been certified"), // 用户芝麻已认证
    USER_AUTH_BANK_PRESUBMIT_NOT_EXISTS(-1113, "Failure of binding card submitted"),
    USER_AUTH_BANK_ALREADY_EXISTS(-1114, "The bank card is bound"),
    APP_NOT_SUPPORT_BANK_BIND(-1115, "The app does not support binding bank cards"),
    BANKCAR_BIND_REPEAT(-1116, "The user has bound the bank card"), //
    USER_BIND_BANKCARD_OVER_LIMIT(-1117, "User card limit exceeded"),
    USER_FROZEN_FACE(-1118, "User face recognition freezing"), //用户人脸识别冷冻
    USER_AUTH_FACE_OVER_TIME(-1119, "Face recognition exceeds daily limit"), //人脸识别超过每日限制
    USER_AUTH_ALIPAY_OVER_TIME(-1121, "Alipay certification exceeds daily limit"), //支付宝认证超过每日限制
    USER_AUTH_TAOBAO_OVER_TIME(-1122, "Taobao certification exceeds daily limit"), //淘宝认证超过每日限制
    USER_AUTH_CREDITCARD_OVER_TIME(-1123, "Credit card certification exceeds daily limit"), // 信用卡认证超过每日限制
    USER_ALREADY_HAVE_CARRIER(-1124, "User certified operator"), //用户已认证运营商
    USER_AUTH_REALNAME_ALREADY(-1125, "User's real name authentication passed"), //用户已实名
    IDENTITYNO_HAVE_AUTHED_BY_OTHER(-1126, "ID card authentication passed"), //身份证已被实名
    USER_REALNAME_NOT_MATCH_WITH_PRE(-1127, "User's multiple real name information is inconsistent"), // 用户多次实名信息不一致
    USER_ONLY_ZM_CAN_CANCEL(-1128, "芝麻才可以取消认证"),
    USER_AUTH_ZM_NOT_EXISTS(-1129, "ZhiMa authentication information does not exist"),
    USER_AUTH_CREDITCARD_NOT_EXISTS(-1130, "Credit card authentication information does not exist"), //信用卡认证信息不存在
    USER_AUTH_BANK_BIND_ERROR(-1131, "Bind card failure"),
    USER_BASE_NOT_EXISTS(-1132, "Basic information does not exist"),//基础信息不存在
    USER_RESIDENTI_NOT_EXISTS(-1133, "Residential information does not exist"),//居住信息不存在
    USER_CONTACT_NOT_EXISTS(-1134, "Contact does not exist"),//联系方式不存在
    USER_WORK_NOT_EXISTS(-1135, "Work information does not exist"),//工作信息不存在
    USER_AUTH_REALNAME_NOT_EXISTS(-1136, "User not real name"), //用户未实名
    USER_AUTH_BANK_NOT_EXISTS(-1137, "Card information does not exist"), //绑卡信息不存在
    USER_EMERGENCY_NOT_EXISTS(-1138, "Emergency contacts do not exist"), //紧急联系人不存在
    USER_CARRIER_NOT_EXISTS(-1139, "Operator authentication does not exist"),//运营商认证不存在
    USER_ADDRESS_BOOK_NOT_EXISTS(-1140, "Address book does not exist"),//通讯录不存在
    USER_HAVE_CATEGORY_QUOTA(-1141, "Users have the category limit"), //用户已有该类目额度
    USER_AUTH_BANK_BINDED_BY_OTHERS(-1142, "The bank card has been bound by others"), //银行卡已被他人绑定
    USER_SOCIAL_HAS_BEEN_BOUND(-1143, "The account has been bound"),//社交账号已被绑定
    USER_AUTH_AADHAAR_BY_OTHERS(-1144, "The account has been bound"),//aadhaar已被绑定
    USER_AUTH_PANCARD_BY_OTHERS(-1145, "The PAN card you are uploading as already associated with another account."),//pancard已被绑定
    USER_AUTH_AADHAAR_NOT_EXISTS(-1146, "The user aadhaar not exist"),//aadhaar不存在
    USER_AUTH_PANCARD_NOT_EXISTS(-1147, "The user pan not exist")//pan不存在
    ;
    /**
     * 状态码
     */
    private Integer code;
    /**
     * 消息内容
     */
    private String msg;

    UserStateCode(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Boolean isSuccess() {
        return this.getCode() >= 0;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    @Override
    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public static UserStateCode getEnumByType(Integer type) {
        UserStateCode userStateCode = null;
        for (UserStateCode enumObj : UserStateCode.values()) {
            if (enumObj.getCode().equals(type)) {
                userStateCode = enumObj;
                break;
            }
        }
        return userStateCode;
    }
}
